package cn.yunhe.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.yunhe.dao.InstrumentDao;
import cn.yunhe.entity.Instrument;
import cn.yunhe.service.InstrumentService;
@Service
public class InstrumentServiceImpl implements InstrumentService {
	@Autowired
	private InstrumentDao instrumentDao;

	@Override
	public List<Instrument> findInstrumentAll() {
		
		return instrumentDao.findInstrumentAll();
	}

	@Override
	public List<Instrument> findInstrumentAllByLikeName(String name) {
		
		return instrumentDao.findInstrumentAllByLikeName(name);
	}

	@Override
	public int addInstrument(Instrument instrument) {
	
		return instrumentDao.addInstrument(instrument);
	}

	@Override
	public int deleteInstrumentByIstate(int drid) {
		
		return instrumentDao.deleteInstrumentByIstate(drid);
	}

	@Override
	public int updateInstrument(Instrument instrument) {
		
		return instrumentDao.updateInstrument(instrument);
	}
	// set get  通过 封装方法 调用 dao 层接口
	public InstrumentDao getInstrumentDao() {
		return instrumentDao;
	}

	public void setInstrumentDao(InstrumentDao instrumentDao) {
		this.instrumentDao = instrumentDao;
	}

	@Override
	public Instrument findInstrumentByIid(int iid) {
		
		return instrumentDao.findInstrumentByIid(iid);
	}

}
